package com.loveprogrammer.eternity.skill.support.states;

import com.loveprogrammer.eternity.model.Character;
import com.loveprogrammer.eternity.model.console.ConsolePrint;
import com.loveprogrammer.eternity.notify.Notify;
import com.loveprogrammer.eternity.skill.State;

import java.util.List;
import java.util.TimerTask;

/**
 * @version 1.0.0
 * @description: 基准状态类
 * @author: eric
 * @date: 2022-08-16 13:51
 **/
public abstract class AbstractState implements State {

    private Integer id;
    private Character character;
    private List<? extends Character> camp;
    private Notify notify;

    public static String string ="\t\t\t\t";
    public AbstractState(Character character,List<? extends Character> camp) {
        this.character = character;
        this.camp = camp;
    }

    public Character getCharacter() {
        return character;
    }

    public void setCharacter(Character character) {
        this.character = character;
    }

    public List<? extends Character> getCamp() {
        return camp;
    }

    public void setCamp(List<? extends Character> camp) {
        this.camp = camp;
    }

    public Notify getNotify() {
        return notify;
    }

    public void setNotify(Notify notify) {
        this.notify = notify;
    }

    public Integer getId() {
        return id();
    }

    public void setId(){
        this.id = id();
    }
    public static String getString() {
        return string;
    }

    public static void setString(String string) {
        AbstractState.string = string;
    }

    @Override
    public void reset() {
        getCharacter().removeState(this);
        doReset();
    }

    protected abstract void doReset();

    public void publishMessage(String message) {
        ConsolePrint.publishMessage(message);
    }
}
